package com.qgs.waf.util;

import java.io.Serializable;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class JSonUtil {
	private static final Gson GSON = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();

	public static String object2JSon(Object t) {
		return GSON.toJson(t);
	}

	public static Object jSon2Object(String json, Class<? extends Serializable> clazz) {
		return GSON.fromJson(json, clazz);
	}

}
